Domain-specific language - Wikipedia
Domain-specific language
A domain-specific language (DSL) is a programming language specialized to a specific application domain.1 This is in contrast to a general-purpose programming language, which is broadly applicable across domains. There are a wide variety of DSLs, ranging from widely used languages, such as SQL, down to languages used by only one or a few pieces of software, such as MUSH soft code. Simpler DSLs, specifically ones used by a single application, are sometimes informally called mini-languages.
The line between general-purpose languages and domain-specific languages is not always sharp, as a language may have specialized features for a given domain, but be applicable more broadly, or conversely may in principle be capable of broad application but in practice used mainly for a specific domain. For example, Perl was originally developed as a text-processing and glue language, for the same domain as AWK and shell scripts, but was mostly used as a general-purpose programming language later on. In contrast, PostScript is a Turing-complete language, and in principle can be used for any task, but in practice is narrowly used as a page description language.
Metaprogramming can involve the creation and usage of a DSL to generate code.23 Some languages like Lisp allow modifying their own syntaxes. When doing so, it is common to speak of the creation of a new DSL.4 Operator overloading, as found in C++, can also create a new DSL.5
DSLs are more often declarative than general-purpose languages.6 Examples: QML, SQL, XSLT, by some people CSS is considered a declarative domain-specific programming language7
Printed 2026-09-23.
Footnotes
-
“What are Domain-Specific Languages (DSL) | MPS by JetBrains”. JetBrains. Retrieved 2026-08-01. A Domain Specific Language is a programming language with a higher level of abstraction optimized for a specific class of problems. A DSL uses the concepts and rules from the field or domain. ↩
-
“String Mixins - D Programming Language”. dlang.org. Retrieved 2026-08-01. String Mixins (not to be confused with template mixins) enable string constants to be compiled as regular D code and inserted into the program. Combining this with compile time manipulation of strings enables the creation of domain-specific languages. ↩
-
jekelly. “About Domain-Specific Languages - Visual Studio (Windows)”. learn.microsoft.com. Retrieved 2026-08-01. A typical application of a DSL is to generate program code or other artifacts. ↩
-
“Extra Credit: Domain Specific Languages · Learn Lisp The Hard Way”. llthw.common-lisp.dev. Retrieved 2026-08-01. You’ve already seen a number of Domain-Specific Languages in Lisp---to recap, a DSL is a convenient, embedded syntax, purpose-designed to achieve natural expression of a problem domain that falls outside the realm of the host programming language and its native syntax. ↩
-
The D Language Foundation (2022-10-09). A Conversation with Walter Bright on the Origins of the D Programming Language (Part 2). 17 minutes in. Retrieved 2026-08-05 – via YouTube. ↩
-
“Procedural vs. declarative data processing in Databricks | Databricks on AWS”. docs.databricks.com. 2026-07-10. Retrieved 2026-08-02. Related concepts: Declarative programming includes domain-specific and functional programming paradigms. ↩
-
Lara (2018-10-07). “CSS is a Declarative, Domain-Specific Programming Language - Lara Schenck”. Lara Schenck. Archived from the original on 2025-08-04. Retrieved 2026-08-02. ↩